package com.cskaoyan.service;

import com.cskaoyan.bean.User;
import com.cskaoyan.bo.RegisterBo;
import com.cskaoyan.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class WxUserAuThServiceImpl implements WxUserAuThService{
    @Autowired
    UserMapper userMapper;
    @Override
    public String selectAvatarUrl(String username) {
        String avatarUrl = userMapper.selectAvatarUrlByName(username);
        return avatarUrl;
    }

    @Override
    public boolean registerUser(RegisterBo registerBo) {
        User user = new User(null, registerBo.getUsername(), registerBo.getPassword(), null, null, null, null, null, null,
                registerBo.getMobile(), "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80", null, null, new Date(), new Date(), false);
        userMapper.insertSelective(user);
        return true;
    }
}
